package com.ysd.lis.controller.sys;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.SysUserRptGroup;
import com.ysd.lis.service.SysUserRptGroupService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 用户报告单元关系表 前端控制器
 * </p>
 *
 * @author HuiXing
 * @since 2024-01-02
 */
@Api(tags = "用户与报告单元对应")
@RestController
@RequestMapping("/api/userRptGroup")
public class SysUserRptGroupController extends BaseController {

    @Autowired
    public SysUserRptGroupService service;

    @ApiOperation("根据用户id查询报告单元id")
    @GetMapping("/findSysUserRptGroupList/{userId}")
    public Result findSysUserRptGroupList(@PathVariable("userId") String userId) {
        return service.findSysUserRptGroupList(userId);
    }
    @ApiOperation("添加用户与报告单元对应关系")
    @PostMapping("/addSysUserRptGroup")
    public Result addSysUserRptGroup(@RequestBody SysUserRptGroup sysUserRptGroup) {
        return service.addSysUserRptGroup(sysUserRptGroup);
    }
    @ApiOperation("批量添加用户与报告单元对应关系")
    @PostMapping("/addBatchSysUserRptGroup")
    public Result addBatchSysUserRptGroup(@RequestBody List<SysUserRptGroup> sysUserRptGroups) {
        return service.addBatchSysUserRptGroup(sysUserRptGroups);
    }
    @ApiOperation("删除用户与报告单元对应关系")
    @PostMapping("/deleteSysUserRptGroup")
    public Result deleteSysUserRptGroup(@RequestBody SysUserRptGroup sysUserRptGroup) {
        return service.deleteSysUserRptGroup(sysUserRptGroup);
    }
}
